package org.particlethink.model;


import org.particlethink.entry.MaterialCategory;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Table(name = "categories")
public class Category {//分类
    @Id
    @KeySql(useGeneratedKeys = true)
    private String id;
    private Date createdAt;
    private Date updatedAt;
    private String name;

    private String parentID;//父分类id
    private MaterialCategory level;//表示层级

    public Category() {
    }

    public Category(String id, Date createdAt, Date updatedAt, String name, String parentID, MaterialCategory level) {
        this.id = id;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
        this.name = name;
        this.parentID = parentID;
        this.level = level;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setLevel(MaterialCategory level) {
        this.level = level;
    }

    public MaterialCategory getLevel() {
        return level;
    }

    public String getParentID() {
        return parentID;
    }

    public void setParentID(String parentID) {
        this.parentID = parentID;
    }

}
